local String = require("String")

-- string
local table_Test1 = String({"t","e","s","t","1"})
local table_Test2 = String({"t","e","s","t","2"})
table_Test1:print()
table_Test2:print()

--重置字符串
table_Test1:reset({"t","e","s","t","3"})
table_Test1:print()

--获取字符串的长度
print(table_Test1:len())

--字符串切片
local table_Sub = table_Test1:sub(1,2) -- 返回的是数组存的字符
for _, v in ipairs(table_Sub) do
    print(v)
end

--字符串添加字符
table_Test1:append({"a","p","p","e","n","d"})
table_Test1:print()

--字符串比较
local bool_Equal = table_Test1:equal(table_Test2)
print(bool_Equal)